<template>
	<view>
		<view class="bg-white br20  p-t-32 p-b-32 item" >
			<view class="flex row-between p-l-25 p-r-25 m-b-28">
				<view class="md bold ">{{item.car_name}}</view>
				<view  v-if="!!item.status" :class="'status-' + item.status" >{{item.status_desc}}</view>
			</view>
			<u-gap height="1" bg-color="#ececec"></u-gap>
			<view class="flex p-b-28 p-l-25 p-r-25 m-t-30">
				<view class="m-r-15">
					<u-icon name="clock" color="#a1a1a1"></u-icon>
				</view>
				<view style="color: #a1a1a1;" class="">
					{{item.create_time}}
				</view>
			</view>
			<view class="p-l-25 p-r-25">
				<view :class="item.address_count>0?'':'m-b-20'">
					<view class="add flex row-center">
						<view class="send-tap">
							<image src="../../static/images/index-add.png" mode=""></image>
						</view>
						<view >
							<view class="bold xs">{{item.address[0].start_address}}</view>
						</view>
					</view>	
				</view>
				<view class="flex m-t-10 m-b-10" v-if="item.address_count>0"  style="position: relative;">
					<view class="m-r-10" style="position: absolute;left: 10rpx;top: -25%;" >
						<s-dot :active="true" backgroundColor="#e85732"></s-dot>
					</view>
					<view style="color: #b6b5b4;" class="xxs m-l-30">{{item.address_count}}个中转站</view>
				</view>
				<view>
					<view class="add flex row-center m-b-30">
						<view class="send-tap">
							<image src="../../static/images/index-sub.png" mode=""></image>
						</view>
							<view>
								<view class="bold xs">{{item.address[0].end_address}}</view>
							</view>
					</view>	
				</view>
			</view>
			<u-gap height="1" bg-color="#ececec"></u-gap>
			<view class="flex row-between p-l-25 p-r-25 m-t-15">
				<view class="flex col-baseline order_price bold">
					<view class="price_icon">￥</view>
					<view class="lg">{{item.order_amount}}</view>
				</view>
				<view class="order_detail sm" @click="getOrderFun(item.id)" >
					{{select==true?'快速重发':'查看详情'}}
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		name:"transport-item",
		
		data() {
			return {
				
			};
		},
		props:{
			item:{
				type:Object,
				default:()=>{}
			},
			isGo:{
				type:Boolean,
				default:()=>true
			},
			select:{
				type:Boolean,
				default:()=>false
			}
		},
		methods:{
			getOrderFun(id){
				// this.$emit('getOrderFun',id)
				if(this.select==true){
					this.$emit('selectSend',id)
					// uni.redirectTo({
					// 	url:'/pages/confirm_order/confirm_order?id=' + id
					// })
				}
				// 拿订单详情=> 
				if(this.select==false){
					
					uni.navigateTo({
						url:'/bundle/pages/order_details/order_details?id=' + id
					})
				}
				
			}
		},
		
	}
</script>

<style scoped lang="scss">
	.item{
		box-shadow: 0uxp 10rpx 10rpx 0rpx #ededed;
		margin-bottom: 35rpx;
		.status-1{
			color: #ffa200;
			background-color: #fff1d9;
			padding: 12rpx 20rpx;
			border-radius: 10rpx 20rpx 10rpx 20rpx;
		}
		.status-2{
			color: #eb7054;
			background-color: #fce6e0;
			padding: 12rpx 20rpx;
			border-radius: 10rpx 20rpx 10rpx 20rpx;
		}
		.status-3{
			color: #2da88f;
			background-color: #e0f2ee;
			padding: 12rpx 20rpx;
			border-radius: 10rpx 20rpx 10rpx 20rpx;
		}
		.add{
			position: relative;
			padding: 30upx 30upx 26upx 55upx;
			height: 110upx;
			border-radius: 20upx;
			background-color: #f3f4f5;
			.send-tap{
				position: absolute;
				top: 0;
				left: 0;
				image{
					width: 60upx;
					height: 60upx;
				}
				
			}
			.comment{
				color: #a0a0a0;
			}
			.map{
				image{
					width: 35upx;
					height: 35upx;
				}
			}
		}
		.order_price{
			color: #e85732;
			.price_icon{
				font-size: 18rpx;
			}
		}
		.order_detail{
			color: #e85732;
			border:1rpx solid #e85732;
			border-radius: 20rpx;
			padding: 16rpx 26rpx;
		}
	}
</style>
